package com.han.demo.listener;

import com.han.demo.event.UserEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @author hanjl
 * @Description 用户监听器
 * @ClassName MyListener
 * @createTime 2021/11/17 15:12
 */
@Component
@Slf4j
public class MyListener implements ApplicationListener<UserEvent> {

    @Override
    public void onApplicationEvent(UserEvent userEvent) {
        log.info("监听获取用户的姓名为：" + userEvent.getName());
    }
}
